1. Technical Field
The present invention pertains to an imaging device and a method for controlling imaging device, and computer-readable storage medium, and particularly relates to imaging device including an imaging element in which phase-difference detection pixels are disposed in a partial region within a light-receiving surface, an imaging device control method that is applicable to the imaging device, and a computer-readable storage medium storing an imaging device control program for execution by a computer disposed in the imaging device.
2. Related Art
Conventionally, phase-difference detection and contrast detection have been known as focus position detection methods in autofocus mechanisms of imaging devices. Phase-difference detection detects the amount of misalignment and the direction of a focal point position with respect to a focus position by using a dedicated sensor to detect misalignment between two images obtained by pupil division from light that has passed through an imaging lens; with phase-difference detection, the focus position can be detected in a relatively short amount of time because it is not necessary to move the focal point position of the imaging lens when detecting the focus position. On the other hand, contrast detection conducts a search for a focal point position (focus position) at which focus evaluation values relating to contrast in an image captured by an imaging element become a maximum while moving the focal point position of the imaging lens; with contrast detection, a dedicated sensor is unnecessary and focusing precision is relatively high.
Because phase-difference detection and contrast detection have different characteristics in this way, technologies that are disposed with the function of using both methods to detect the focus position and which select the method to be used for focusing have been proposed. For example, JP-A No. 2010-139942 discloses a technology where, in an imaging device including phase-difference pixels and normal pixels, the value of an evaluation function for evaluating whether or not distance measurement using phase-difference AF (autofocus) is possible is compared to a threshold value to thereby determine the reliability of phase-difference AF; when the determined reliability is high, a focus lens is driven in the direction of the focus position detected using phase-difference AF, and when the reliability of phase-difference AF is low, the focus is driven in the direction of the focus position detected using contrast AF and the focus lens is driven to the focus position resulting from contrast AF, whose precision is high in the vicinity of the focus position.
Phase-difference detection has the drawback that, compared to contrast detection, the conditions of subjects whose focus position is detectable are limited; more specifically, phase-difference detection has the problem that in a case where the distribution range, on the light-receiving surface of the imaging element, of a subject that is the focus target is large with respect to the size of the detection region for detecting phase difference (a case where the size of the subject on the light-receiving surface of the imaging element is large or where the size of the subject on the light-receiving surface of the imaging element is small but plural subjects existing at proximate distances exist in proximate positions on the light-receiving surface), the precision of focus position detection can be ensured, but in a case where the distribution range, on the light-receiving surface of the imaging element, of the subject that is the focus target is small, the precision of focus position detection drops.
With respect to this, in the technology described in JP-A No. 2010-139942 mentioned above, the value of the evaluation function for evaluating whether or not distance measurement using phase-difference AF is possible is compared to the threshold value to thereby determine the reliability of phase-difference AF. For this reason, in the technology described in JP-A No. 2010-139942, there is the potential for focus position detection to be performed using phase-difference detection also in a case where a subject not suited for focus position detection using phase-difference detection is to be captured, and in this case the precision of focus control drops as a result of being unable to detect the focus position or an erroneously detected focus position being used. Further, there also arises the problem that, in a case where focus position detection is switched to contrast detection when the focus position was unable to be detected using phase-difference detection, the amount of time from when focusing is instructed to until focusing is completed becomes longer.